gdkwayland-window: Don't map the grab transfer menu for GtkMenu
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 13 Aug 2014 23:01:52 +0000 (19:01 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 13 Aug 2014 23:03:39 +0000 (19:03 -0400)
This is a bad idea in general, but it also means that the focus for a
window drops when we pop up a menu, since the grab transfer menu exists.

gdk/wayland/gdkwindow-wayland.c

index 41e6fb1b107ec700d259a3eeb5185c79f5ed60a4..f26c3e0c3a56b9d94815ee46c67e49d846ccfcd2 100644 (file)
@@ -1031,12 +1031,25 @@ find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for)
   return NULL;
 }
 
+static gboolean
+should_be_mapped (GdkWindow *window)
+{
+  /* Don't map crazy temp that GTK+ uses for internal X11 shenanigans. */
+  if (window->window_type == GDK_WINDOW_TEMP && window->x < 0 && window->y < 0)
+    return FALSE;
+
+  return TRUE;
+}
+
 static void
 gdk_wayland_window_map (GdkWindow *window)
 {
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
   GdkWindow *transient_for;
 
+  if (!should_be_mapped (window))
+    return;
+
   if (!impl->mapped && !impl->use_custom_surface)
     {
       /* Popup menus can appear without a transient parent, which means they